001 /* 002 * Copyright 2004-2005 Stephen J. McConnell. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 013 * implied. 014 * 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019 package net.dpml.transit.tools; 020 021 import java.net.URI; 022 023 /** 024 * Utility class that declares a map between a urn and a plugin uri. 025 * 026 * @author <a href="http://www.dpml.net">The Digital Product Meta Library</a> 027 * @version 1.0.0 028 */ 029 public class MapDataType 030 { 031 private String m_urn; 032 private URI m_uri; 033 034 /** 035 * Set the urn value. 036 * @param urn the urn 037 */ 038 public void setUrn( String urn ) 039 { 040 m_urn = urn; 041 } 042 043 /** 044 * Get the urn value. 045 * @return the urn 046 */ 047 public String getURN() 048 { 049 if( null == m_urn ) 050 { 051 throw new IllegalStateException( "urn" ); 052 } 053 return m_urn; 054 } 055 056 /** 057 * Set the uri value. 058 * @param uri the uri 059 */ 060 public void setUri( URI uri ) 061 { 062 m_uri = uri; 063 } 064 065 /** 066 * Get the uri value. 067 * @return the uri 068 */ 069 public URI getURI() 070 { 071 if( null == m_urn ) 072 { 073 throw new IllegalStateException( "uri" ); 074 } 075 return m_uri; 076 } 077 078 /** 079 * Return the string representing of this instance. 080 * @return the string value 081 */ 082 public String toString() 083 { 084 return "[map urn:" + m_urn + " uri:" + m_uri + "]"; 085 } 086 } 087